import Vue from 'vue'
import Vuex from 'vuex'

//
import { getAppId } from '@/utils/common'

// 
import plugins from './plugins/index'
import createPersistedState from 'vuex-persistedstate'

import user from './modules/user'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    user
  },
  plugins: [
    createPersistedState({
      key: `vuex@${getAppId()}`,
      paths: [
        'user.userInfo'
      ],
      storage: window.sessionStorage
    }),
    plugins],
  strict: process.env.NODE_ENV === 'production'
})